<%@ page contentType="application/json "language="java" import="java.sql.*" errorPage="" %>
<%@ page import="com.urp.sistema.despachadores.*" %>
<%@ page import="com.urp.sistema.beans.ModuloBean" %>
<%@ page import="java.util.List" %>
<%
    String user=request.getParameter("cusername");
    String aplica=request.getParameter("app");

    List <ModuloBean>li=ModuloRolOpcionDespachador.cargarModulo(this,user, aplica);
    int codAnt=0;
    int i=0;
%>
[{ text: "Sistema",expanded: true,cls: "folder",children:[
<%
    for(ModuloBean b:li){
        if(codAnt!=b.getNmodu_codigo()){
            codAnt=b.getNmodu_codigo();
            if(i>0){%>]},<%}%>
            {text:"<%=b.getCmodu_descripcion()%>",leaf:false,children:[
              {text:"<%=b.getCopci_descripcion()%>",id:"<%=b.getCopci_url()%>", cls:"file", leaf:true}
            <%if(i==li.size()-1){%>]}<%}
        }else{
            if(i>0){%>,<%}%>
            {text:"<%=b.getCopci_descripcion()%>",id:"<%=b.getCopci_url()%>", cls:"file", leaf:true}
             <%if(i==li.size()-1){%>]}<%}
        }
        i++;
    }
%>
]}]
